// /pages/inbound-record/index.less

/* --- 颜色变量 --- */
@text-primary: #303133;
@text-regular: #606266;
@text-secondary: #909399;
@text-placeholder: #c0c4cc;

@theme-color: #19be6b;
@theme-color-dark: #18b566;
@danger-color: #f56c6c;
@warning-color: #f9ae3d;

/* --- 字体大小变量 --- */
@font-size-lg: 28rpx;
@font-size-md: 26rpx;
@font-size-sm: 24rpx;
@font-size-xs: 22rpx;

/* --- 动画定义 --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20rpx);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- 全局与容器 --- */
.container {
  background-color: #f7f8fa;
  min-height: 100vh;
  padding: 24rpx 0;
  box-sizing: border-box;
}

/* --- 加载样式 --- */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 30vh;
  .loading-spinner {
    width: 48rpx;
    height: 48rpx;
    border: 4rpx solid @theme-color;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  .loading-text {
    margin-top: 20rpx;
    font-size: @font-size-sm;
    color: @text-secondary;
  }
}


/* --- 卡片样式 --- */
.record-card {
  background-color: #ffffff;
  margin: 0 24rpx 24rpx;
  border-radius: 16rpx;
  padding: 32rpx;
  position: relative;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  animation: fadeIn 0.5s ease-out forwards;
}

.status-tag-wrapper {
  position: absolute;
  top: 32rpx;
  right: 32rpx;
}

/* 卡片头部 */
.card-header {
  color: @text-regular;
  font-size: @font-size-sm;
  
  .address-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 20rpx;
    .address-text {
      font-size: @font-size-md;
      color: @text-primary;
      font-weight: bold;
    }
    .order-id-text {
      font-size: @font-size-xs;
      color: @text-secondary;
      margin-top: 6rpx;
    }
  }

  .handler-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16rpx;

    .participants {
      display: flex;
      align-items: center;
      .participants-count {
        font-size: @font-size-xs;
        color: @text-secondary;
        margin-left: 16rpx;
      }
    }
    .handler-name {
      font-size: @font-size-xs;
      color: @text-secondary;
    }
  }

  .user-remark {
    font-size: @font-size-xs;
    color: @text-secondary;
    background-color: #f7f8fa;
    padding: 10rpx 16rpx;
    border-radius: 8rpx;
  }
}

.divider {
  height: 1px;
  background-color: #ebedf0;
  margin: 24rpx 0;
}

/* 卡片中部 */
.card-body {
  .item-details {
    font-size: @font-size-sm;
    color: @text-regular;
    .detail-header, .detail-row {
      display: flex;
      align-items: center;
      padding: 16rpx 0;
    }
    .detail-header {
      color: @text-secondary;
      font-size: @font-size-xs;
    }
    .detail-row {
      border-bottom: 1px solid #f7f8fa;
      &:last-child {
        border-bottom: none;
      }
    }

    .header-name, .cell-name { flex: 2; text-align: left; }
    .header-unitprice, .cell-unitprice { flex: 1.5; text-align: center; }
    .header-value, .cell-value { flex: 1; text-align: center; }
    .header-total, .cell-total { flex: 1.5; text-align: right; }
    .cell-total { color: @danger-color; }
  }

  .rejection-info {
    .rejection-title {
      display: block;
      font-size: @font-size-xs;
      color: @text-secondary;
      margin-bottom: 8rpx;
    }
    .rejection-reason {
      font-size: @font-size-sm;
      color: @warning-color;
      background-color: lighten(@warning-color, 35%);
      padding: 16rpx;
      border-radius: 8rpx;
      display: block;
    }
  }
}

/* 卡片底部 */
.card-footer {
  margin-top: 24rpx;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  .total-amount-wrapper {
    color: @text-regular;
    font-size: @font-size-md;
    display: flex;
    .total-amount-value {
      flex:1;
      font-size: @font-size-lg;
      font-weight: bold;
      color: @theme-color;
    }
  }

  .completion-time {
    flex:1;
    font-size: @font-size-xs;
    color: @text-secondary;
    width: 100%;
    text-align: right;
  }
}
